<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8" />
    <title>粑粑去哪儿</title>
    <meta content="telephone=no" name="format-detection"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link type="text/css" href="./styles/style.css" rel="stylesheet">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="browsermode" content="application"/>
</head>
<body>

<div class="main">
    <section class="section" style="padding:0 0 90px 0;overflow:hidden;">
        <div class="list-title">
            你在哪里拉过粑粑？
        </div>
        <div class="list">
            <div class="l-title">A</div>
            <div class="list-item J_sel" data-id="1">
                <span>安徽</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="2">
                <span>澳门</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">B</div>
            <div class="list-item J_sel" data-id="3">
                <span>北京</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">C</div>
            <div class="list-item J_sel" data-id="4">
                <span>重庆</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">F</div>
            <div class="list-item J_sel" data-id="5">
                <span>福建</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">G</div>
            <div class="list-item J_sel" data-id="6">
                <span>甘肃</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="7">
                <span>广东</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="8">
                <span>广西</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="9">
                <span>贵州</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">H</div>
            <div class="list-item J_sel" data-id="10">
                <span>海南</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="11">
                <span>河北</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="12">
                <span>黑龙江</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="13">
                <span>河南</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="14">
                <span>湖北</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="15">
                <span>湖南</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">J</div>
            <div class="list-item J_sel" data-id="16">
                <span>江苏</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="17">
                <span>江西</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="18">
                <span>吉林</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">L</div>
            <div class="list-item J_sel" data-id="19">
                <span>辽宁</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">N</div>
            <div class="list-item J_sel" data-id="20">
                <span>内蒙古</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="21">
                <span>宁夏</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">Q</div>
            <div class="list-item J_sel" data-id="22">
                <span>青海</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">S</div>
            <div class="list-item J_sel" data-id="23">
                <span>陕西</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="24">
                <span>山东</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="25">
                <span>上海</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="26">
                <span>山西</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="27">
                <span>四川</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">T</div>
            <div class="list-item J_sel" data-id="28">
                <span>台湾</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="29">
                <span>天津</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">X</div>
            <div class="list-item J_sel" data-id="30">
                <span>香港</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="31">
                <span>新疆</span>
                <em></em>
            </div>
            <div class="list-item J_sel" data-id="32">
                <span>西藏</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">Y</div>
            <div class="list-item J_sel" data-id="33">
                <span>云南</span>
                <em></em>
            </div>
        </div>
        <div class="list">
            <div class="l-title">Z</div>
            <div class="list-item J_sel" data-id="34">
                <span>浙江</span>
                <em></em>
            </div>
        </div>
    </section>
    <section class="list-btn">
        <a href="###" id="J_share_link" class="ui-btn">拉粑粑完成</a>
    </section>
</div>

<script type="text/javascript" src="./js/zepto.min.js"></script>
<script type="text/javascript">
    (function(){
        var sel_id = "";
        $(".J_sel").on("tap", function(){
            var is_sel = $(this).attr("data-sel");
            if(is_sel == 1){
                var reg = new RegExp("(^|,)"+ $(this).attr("data-id") +",");
                sel_id = sel_id.replace(reg, "$1");
                $(this).attr("data-sel", 0).removeClass("list-item-sel");
            }else{
                sel_id += $(this).attr("data-id") +",";
                $(this).attr("data-sel", 1).addClass("list-item-sel");
            }
            $("#J_share_link").attr("href", "./share.php#"+ sel_id.replace(/,$/, ""))
        });
        $("#J_share_link").click(function(){
            if(sel_id == ""){
                alert("至少要选一个拉过粑粑的地方哦！");
                return false;
            }
        });


        var share_desc = "艾玛太搞了！“粑粑”去哪儿，标记你在哪些地方拉过粑粑！";
        var share_url = "http://www.haoqiao.cn/baba/index.html";
        var share_img = "http://www.haoqiao.cn/baba/images/baba_share_icon_4.png";
        var jump_url = "http://mp.weixin.qq.com/s?__biz=MjM5ODU4OTA2MA==&mid=200533306&idx=1&sn=424b2c54680931e5d031d43890a5ab6b#rd";

        document.addEventListener("WeixinJSBridgeReady", function(){
            WeixinJSBridge.on("menu:share:appmessage",
                function(e){
                    WeixinJSBridge.invoke("sendAppMessage", {
                        img_url : share_img,
                        link : share_url,
                        desc : share_desc,
                        title : "粑粑去哪儿"
                    }, function(e){
                        if(typeof $ != "undefined"){
                            $.ajax({
                                url : "/ajax/baba_tj", 
                                data : {
                                    type : "列表页好友分享"
                                },
                                type : "GET",
                                dataType : "json",
                                success : function(){}
                            });
                        }
                        //document.location.href = jump_url;
                    })
                }
            ), WeixinJSBridge.on("menu:share:timeline", function(e){
                    WeixinJSBridge.invoke("shareTimeline", {
                        img_url : share_img,
                        img_width : "640", 
                        img_height : "640", 
                        link : share_url,
                        desc : share_desc, 
                        title : share_desc
                    }, function(e){
                        if(typeof $ != "undefined"){
                            $.ajax({
                                url : "/ajax/baba_tj", 
                                data : {
                                    type : "列表页朋友圈分享"
                                },
                                type : "GET",
                                dataType : "json",
                                success : function(){}
                            });
                        }
                        //document.location.href = jump_url;
                    })
                })
        }, !1);
    })();
</script>

<!-- www.weixin199.com/youxi Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F048fdec886cd53f8bb62cee837c505c2' type='text/javascript'%3E%3C/script%3E"));
</script>
</body>
</html>
>